import request from '@/utils/request'

const api_name = '/access'
export default {
  //添加
  registerConnector(data) {
    return request({
      url:`${api_name}/registerConnector`,
      method: 'post',
      data: data
    })
  },
  //查询所有
  getConnectorList(name){
    return request({
      url: `${api_name}/getConnectorList/${name}`,
      method: 'get',
    })
  },
  //修改
  updateConnector(data){
    return request({
      url: `${api_name}/updateConnector`,
      method: 'put',
      headers:{'Content-Type': 'application/json;charset=UTF-8'},
      data: data
    })
  },
  //删除
  deleteConnector(name){
    return request({
      url: `${api_name}/deleteConnector?name=${name}`,
      method: 'get'
    })
  },
  //恢复
  resumeConnector(name){
    return request({
      url: `${api_name}/resumeConnector?name=${name}`,
      method: 'get'
    })
  },
  //暂停
  pauseConnector(name){
    return request({
      url: `${api_name}/pauseConnector?name=${name}`,
      method: 'get'
    })
  },
  //查询详情
  getConnectorDetail(name){
    return request({
      url: `${api_name}/getStatus?name=${name}`,
      method: 'get'
    })
  }
}
